package com.tg.paw.ums.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.tg.paw.common.entity.BaseEntity;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.NoArgsConstructor;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

/**
 * <p>
 * 权限
 * </p>
 *
 * @author Rubble
 * @since 2020-10-22
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ums_permission")
@ApiModel(value="Permission对象", description="权限")
public class Permission extends BaseEntity {


    @ApiModelProperty(value = "主键")
    @TableId(value = "permission_id", type = IdType.AUTO)
    @JsonSerialize(using= ToStringSerializer.class)
    private Long permissionId;

    @ApiModelProperty(value = "父级权限id")
    @TableField("parent_id")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long parentId;

    @ApiModelProperty(value = "权限名称")
    @TableField("permission_name")
    private String permissionName;

    @ApiModelProperty(value = "权限")
    @TableField("authority")
    private String authority;

    @ApiModelProperty(value = "图标")
    @TableField("icon")
    private String icon;

    @ApiModelProperty(value = "权限类型: (0: 目录; 1: 菜单; 2: 按钮)")
    @TableField("permission_type")
    private Integer permissionType;

    @ApiModelProperty(value = "路由路径")
    @TableField("route_path")
    private String routePath;

    @ApiModelProperty(value = "组件路径")
    @TableField("component")
    private String component;

    @ApiModelProperty(value = "外部链接: (0: 否; 1: 是)")
    @TableField("is_outer")
    private Integer isOuter;

    @ApiModelProperty(value = "排序")
    @TableField("sort")
    private Integer sort;

    @ApiModelProperty(value = "启用状态: (0: 禁用; 1: 启用)")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(value = "逻辑删除 (0: 正常; 1: 删除)")
    @TableField("delete_status")
    @TableLogic
    private Integer deleteStatus;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "创建者")
    @TableField(value = "creator", fill = FieldFill.INSERT)
    private String creator;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "修改者")
    @TableField(value = "modifier", fill = FieldFill.UPDATE)
    private String modifier;

    @ApiModelProperty(value = "子权限")
    @TableField(exist = false)
    private List<Permission> children;


}
